package com.example.kotlinlearn.kotlinLearn

import kotlin.random.Random

fun main(){
    val str:String = "Hello World"
    val char:Char = '你'
    val int:Int = 1324242
    val double:Double = 2.456
    val float:Float = 134242.989f
    val list:List<String> = listOf("a0sds","sfsfsfs","fsfsfsf")
    println(str+int+char+list)
    val muList = mutableListOf<Int>(1,2,3,4,5,6)
    muList.add(1,20)
    val list1 = mutableListOf<String>("ffd","fdf","45","848")
    val list2 = mutableListOf<Int>(1,2,3,3)
    val list3 = mutableListOf<Int>(12,21,33,35)
    val list4 = mutableListOf<Int>(17,28,39,36)
    val set = setOf<Int>(1,2,3,4,1,1,14,2,4,3,4,12)
    val setlist = setOf<MutableList<Int>>(list2,list3,list4)
    print(setlist.first()[0])
    println(1000%100)
    val charList = listOf<Char>('门','二','三','四','五','六','七','八','九','十')
    for (i in 0..10000){
        val num = (0..9).random()
        print(charList[num])
        if (i % 100 == 0) println("")
    }
}

fun getMax(num1:Int, num2:Int): Int {
    return if (num1>num2) num1 else num2
}

//if具有返回值，返回条件中最后一个语句的值
fun getMin(num1:Int,num2:Int) = if (num1> num2) num2 else num1

